<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<div class="table-responsive">
<c:import url="commonStat.jsp" />
<table class="cntable table table-bordered dataTable table-employee ">
	<thead>
		<tr>
			<th style="width:50px">序号</th>
			<th style="width:130px">供应商</th>
			<th style="width:130px">采购单号</th>

			<th style="width:130px">应付金额(元)</th>
			<th style="width:130px">已付金额(元)</th>
			<th style="width:130px">支付状态</th>
			<th style="width:130px">采购时间</th>
			<th>备注</th>

		</tr>
	</thead>
	<tbody>
		<c:forEach var="purchase" items="${purchases}" varStatus="status">
			<tr data-id="${purchase.purchaseId}" >
				<td>${status.index+1}</td>
				<td>${purchase.supplier.supplierName}</td>
				<td>${purchase.purchaseNo}</td>
			
				<td><fmt:formatNumber value="${purchase.purchaseMoney+purchase.otherMoney}" pattern="0.00"></fmt:formatNumber></td>
				<td><fmt:formatNumber value="${purchase.havePayMoney}" pattern="0.00"></fmt:formatNumber></td>
				<c:if test="${purchase.payState=='paid'}">
					<td style="color:green" ><t:provider packageName="billing" enumClassName="PayState" value="${purchase.payState}"/></td>
				</c:if>
				<c:if test="${purchase.payState=='portion'}">
					<td style="color:blue" ><t:provider packageName="billing" enumClassName="PayState" value="${purchase.payState}"/></td>
				</c:if>
				<c:if test="${purchase.payState=='unpaid'}">
					<td style="color:red"><t:provider packageName="billing" enumClassName="PayState" value="${purchase.payState}"/></td>
				</c:if>
				<c:if test="${purchase.payState!='unpaid'&&purchase.payState!='portion'&&purchase.payState!='paid'}">
					<td><t:provider packageName="billing" enumClassName="PayState" value="${purchase.payState}"/></td>
				</c:if>
				<td><fmt:formatDate value="${purchase.createDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd HH:mm"/></td>
				<td>${purchase.comment}</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<th class="pager-th">
				<%@ include file="/WEB-INF/views/shared/master/pager.jsp"%>
			</th>
		</tr>
	</tfoot>
</table>
</div>